import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/login' },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/user/login')
  },
  {
    path: '/home',
    name: 'Home',
    redirect: '/category',
    component: () => import('../views/home/home'),
    children: [
      { path: '/ad', component: () => import('../views/assets_management/ad') },
      {
        path: '/assets',
        component: () => import('../views/assets_management/assets')
      },
      {
        path: '/category',
        component: () => import('../views/management_center/category')
      },
      {
        path: '/label',
        component: () => import('../views/management_center/label')
      },
      {
        path: '/user',
        component: () => import('../views/management_center/user')
      },
      {
        path: '/data',
        component: () => import('../views/data/data')
      },
      {
        path: '/manager',
        component: () => import('../views/management_center/manager')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
